package net.ustc.javamemcached;

import net.ustc.javamemcached.bootstrap.BootStrap;
import net.ustc.javamemcached.memorystore.MemoryEntry;



/**
 * Command line interface to the Java memcache daemon.
 *
 * Arguments in general parallel those of the C implementation.
 */
public class Main {

    public static void main(String[] args) throws Exception {
    	BootStrap bootStrap = new BootStrap();
		bootStrap.config();
    	
    	final MemCacheDaemon<MemoryEntry> daemon = new MemCacheDaemon<MemoryEntry>();

        
        daemon.start();

        Runtime.getRuntime().addShutdownHook(new Thread(new Runnable() {
            public void run() {
                if (daemon.isRunning()) daemon.stop();
            }
        }));
    }


}
